import { COMMENT_LIST_DATA, SETLOADSTATE } from './actionTypes';
import axios from 'axios';

export const getListData = () => async (dispatch) => {
  dispatch({
    type: SETLOADSTATE,
    obj: false
  });
  let res = await axios.get('./json/comments.json')

  dispatch({
    type: COMMENT_LIST_DATA,
    obj: res.data
  });

  dispatch({
    type: SETLOADSTATE,
    obj: true
  });
}